Skip to content

Fix tests for Pydantic 2.11 #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

medaminezghal
Copy link
Contributor

This is a fix for this issue.

@medaminezghal
Copy link
Contributor Author

@dsp-ant This is a fix to make the sdk compatible with Pydantic 2.11 otherwise the tests will fail.

@medaminezghal
Copy link
Contributor Author

@ihrpr @Kludex @dsp-ant would you review this pull request?
It’s needed to fix this error: Error executing tool add: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.

you can try to check if it exist using Pydantic 2.11. You won’t get this error if you’re using Pydantic 2.10.

@Kludex
Copy link
Member

Kludex commented Apr 11, 2025

Happy to review if you remove all the formatting from this PR.

@medaminezghal
Copy link
Contributor Author

@Kludex I’ve just followed the contribution guide. So I think the formatting is part of the guide.

@Kludex
Copy link
Member

Kludex commented Apr 11, 2025

There was a mismatch on ruff version between CI and the pre-commit. I fixed it yesterday.

There are many changes in this PR that are formatting.

I mean, it's our fault, but I'd appreciate if those unrelated changes are stripped from this PR. 🙏

@medaminezghal
Copy link
Contributor Author

I mean, it's our fault, but I'd appreciate if those unrelated changes are stripped from this PR. 🙏

I've fixed the formatting issue now. Could you review it?

@Kludex Kludex merged commit 70115b9 into modelcontextprotocol:main Apr 11, 2025
6 checks passed
@medaminezghal medaminezghal deleted the pydantic2.11-support branch April 11, 2025 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants